package com.hsc.yalebao.adapter;

import android.annotation.SuppressLint;
import android.content.Context;
import android.content.res.Resources;
import android.text.Html;
import android.text.Spanned;
import android.text.method.LinkMovementMethod;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;
import com.hsc.yalebao.model.IssueRecordListBaseBean;
import java.util.ArrayList;
import java.util.HashMap;

public class IssueRecordListAdapter extends BaseAdapter
{
  String TAG = "IssueRecordListAdapter";
  int colorGreen = -1;
  int colorRed = 0;
  private Context context;
  int count = 1;
  ViewHolder holder = null;
  private LayoutInflater inflater;
  private ArrayList<IssueRecordListBaseBean> list;
  HashMap<Integer, View> mapView = new HashMap();
  private Resources resources = null;
  int ylb_mine_backwater_background_color = 0;

  public IssueRecordListAdapter(Context paramContext, ArrayList<IssueRecordListBaseBean> paramArrayList)
  {
    this.context = paramContext;
    this.inflater = LayoutInflater.from(paramContext);
    this.list = paramArrayList;
    this.resources = paramContext.getResources();
    this.colorGreen = this.resources.getColor(2131165321);
    this.colorRed = this.resources.getColor(2131165214);
    this.ylb_mine_backwater_background_color = this.resources.getColor(2131165398);
  }

  private int findStrIndex(String paramString1, String paramString2)
  {
    String[] arrayOfString = paramString1.split(",");
    if (arrayOfString.length != 0);
    for (int i = 0; ; i++)
    {
      if (i >= arrayOfString.length)
        return -1;
      if (paramString2.equals(arrayOfString[i]))
        break;
    }
    return i;
  }

  private String setSimlerTextColorFromStr(String paramString1, String paramString2)
  {
    findStrIndex(paramString1, paramString2);
    String str = "";
    String[] arrayOfString = paramString1.split(",");
    int i;
    if (arrayOfString.length != 0)
    {
      i = 0;
      if (i < arrayOfString.length);
    }
    else
    {
      return str;
    }
    if (!paramString2.equals(arrayOfString[i]))
      if (i == -1 + arrayOfString.length)
        str = str + "<font color='#676767'>" + arrayOfString[i] + "</font>";
    while (true)
    {
      i++;
      break;
      str = str + "<font color='#676767'>" + arrayOfString[i] + ",</font>";
      continue;
      if (i == -1 + arrayOfString.length)
        str = str + "<font color='#FF0001'>" + paramString2 + "</font>";
      else
        str = new StringBuilder(String.valueOf(str)).append("<font color='#FF0001'>").append(paramString2).append("</font>").toString() + "<font color='#676767'>,</font>";
    }
  }

  public int getCount()
  {
    if (this.list == null)
      return 0;
    return this.list.size();
  }

  public Object getItem(int paramInt)
  {
    return this.list.get(paramInt);
  }

  public long getItemId(int paramInt)
  {
    return paramInt;
  }

  @SuppressLint({"NewApi"})
  public View getView(int paramInt, View paramView, ViewGroup paramViewGroup)
  {
    if (paramView == null)
    {
      ViewHolder localViewHolder1 = new ViewHolder();
      this.holder = localViewHolder1;
      paramView = this.inflater.inflate(2130903150, null);
      this.holder.tv_issue_name = ((TextView)paramView.findViewById(2131100161));
      this.holder.tv_yingkui_jine = ((TextView)paramView.findViewById(2131100162));
      this.holder.tv_kaijiang_result = ((TextView)paramView.findViewById(2131100163));
      this.holder.tv_kaijiang_stype = ((TextView)paramView.findViewById(2131100164));
      this.holder.tv_touzhu_stype = ((TextView)paramView.findViewById(2131100165));
      this.holder.tv_touzhu_jine = ((TextView)paramView.findViewById(2131100166));
      this.holder.tv_win_jine = ((TextView)paramView.findViewById(2131100167));
      this.holder.tv_touzhu_time = ((TextView)paramView.findViewById(2131100168));
      ViewHolder localViewHolder2 = this.holder;
      paramView.setTag(localViewHolder2);
    }
    IssueRecordListBaseBean localIssueRecordListBaseBean;
    while (true)
    {
      localIssueRecordListBaseBean = (IssueRecordListBaseBean)this.list.get(paramInt);
      if (localIssueRecordListBaseBean != null)
        break;
      return paramView;
      this.holder = ((ViewHolder)paramView.getTag());
    }
    String str1 = localIssueRecordListBaseBean.getOrder_Status();
    String str2 = localIssueRecordListBaseBean.getLotteryName();
    localIssueRecordListBaseBean.getLotteryId();
    String str3 = localIssueRecordListBaseBean.getBet_Time();
    String str4 = localIssueRecordListBaseBean.getIssue();
    String str5 = localIssueRecordListBaseBean.getBet_str();
    String str6 = localIssueRecordListBaseBean.getMoney();
    String str7 = localIssueRecordListBaseBean.getBonus();
    localIssueRecordListBaseBean.getPlayId();
    String str8 = localIssueRecordListBaseBean.getPlayName().trim();
    String str9 = localIssueRecordListBaseBean.getRealResult().replace(",", " + ");
    String str10 = localIssueRecordListBaseBean.getSumValue();
    String str11 = localIssueRecordListBaseBean.getIsWon();
    String str12 = localIssueRecordListBaseBean.getRuleName();
    String str13 = localIssueRecordListBaseBean.getRealWin();
    try
    {
      double d1 = Double.parseDouble(str6);
      double d2 = Double.parseDouble(str7);
      i = (int)(d2 - d1);
      this.holder.tv_issue_name.setText(str2 + " -- " + str4 + "期");
      str5.split(",");
      if ("-1".equals(str1))
      {
        this.holder.tv_yingkui_jine.setText("已撤单");
        this.holder.tv_yingkui_jine.setTextColor(this.context.getResources().getColor(2131165403));
        if (!"1".equals(str11))
          break label1020;
        Spanned localSpanned1 = Html.fromHtml(new StringBuilder(String.valueOf(new StringBuilder("<font color='#676767'>投注类型：").append(str8).append("(</font>").toString())).append("<font color='#FF0001'>").append(str12).append("</font>").toString() + "<font color='#676767'>)</font>");
        this.holder.tv_touzhu_stype.setText(localSpanned1);
        this.holder.tv_touzhu_stype.setMovementMethod(LinkMovementMethod.getInstance());
        this.holder.tv_touzhu_jine.setText("投注金额：" + str6 + " 元宝");
        this.holder.tv_win_jine.setText("中奖金额：" + str7 + " 元宝");
        this.holder.tv_touzhu_time.setText(str3);
        return paramView;
      }
    }
    catch (Exception localException)
    {
      while (true)
      {
        localException.printStackTrace();
        int i = 0;
        continue;
        if (("1".equals(str1)) || ("2".equals(str1)))
        {
          this.holder.tv_yingkui_jine.setText("开奖中");
          this.holder.tv_yingkui_jine.setVisibility(4);
          this.holder.tv_kaijiang_result.setText("等待开奖");
          this.holder.tv_kaijiang_result.setTextColor(this.colorRed);
          this.holder.tv_kaijiang_stype.setText("等待开奖");
          this.holder.tv_kaijiang_stype.setTextColor(this.colorRed);
          this.holder.tv_touzhu_stype.setText("投注类型：" + str8 + "(" + str12 + ")");
          this.holder.tv_touzhu_stype.setTextColor(this.ylb_mine_backwater_background_color);
        }
        else if ("3".equals(str1))
        {
          this.holder.tv_yingkui_jine.setVisibility(0);
          if (i > 0)
          {
            this.holder.tv_yingkui_jine.setText("+" + i + " 元宝");
            this.holder.tv_yingkui_jine.setTextColor(this.colorRed);
          }
          while (true)
          {
            this.holder.tv_kaijiang_result.setText(str9 + " = " + str10);
            this.holder.tv_kaijiang_result.setTextColor(this.ylb_mine_backwater_background_color);
            Spanned localSpanned2 = Html.fromHtml(setSimlerTextColorFromStr(str13, str12));
            this.holder.tv_kaijiang_stype.setText(localSpanned2);
            this.holder.tv_kaijiang_stype.setMovementMethod(LinkMovementMethod.getInstance());
            break;
            this.holder.tv_yingkui_jine.setText(i + " 元宝");
            this.holder.tv_yingkui_jine.setTextColor(this.colorGreen);
          }
          label1020: this.holder.tv_touzhu_stype.setText("投注类型：" + str8 + "(" + str12 + ")");
          this.holder.tv_touzhu_stype.setTextColor(this.ylb_mine_backwater_background_color);
        }
      }
    }
  }

  public void setData(ArrayList<IssueRecordListBaseBean> paramArrayList)
  {
    this.list = paramArrayList;
  }

  public class ViewHolder
  {
    private TextView tv_issue_name;
    private TextView tv_kaijiang_result;
    private TextView tv_kaijiang_stype;
    private TextView tv_touzhu_jine;
    private TextView tv_touzhu_stype;
    private TextView tv_touzhu_time;
    private TextView tv_win_jine;
    private TextView tv_yingkui_jine;

    public ViewHolder()
    {
    }
  }
}

/* Location:           C:\Users\user\Desktop\dd28_pcdd720\classes_dex2jar.jar
 * Qualified Name:     com.hsc.yalebao.adapter.IssueRecordListAdapter
 * JD-Core Version:    0.6.2
 */